package com.im.util;

public class XmppUtil {

	public static String getUserNameByUserJID(String userJID) {
		if (userJID == null || userJID.trim().length() == 0)
			return null;
		return userJID.trim().split("/")[0].trim();
	}

	public static String getUserJID(String userName, String serviceName) {
		return userName.trim() + "@" + serviceName.trim();
	}

	public static String getUserJIDFull(String userName, String serviceName, String resourceName) {
		return userName.trim() + "@" + serviceName.trim() + "/" + resourceName.trim();
	}

}
